﻿using HDM.NexusEngine.Core;

namespace HDM.NexusEngine.EngineTest
{
    public class SoundTestState : IGameObject
    {
        private SoundManager _soundManager;
        private double _count = 3;

        public SoundTestState(SoundManager soundManager)
        {
            _soundManager = soundManager;
            _soundManager.MasterVolume(0.1f);
        }

        public void Update(double elapsedTime)
        {
            _count -= elapsedTime;
            if (_count<0)
            {
                _count = 3;
                var soundOne = _soundManager.PlaySound("effect");
                //var soundTwo = _soundManager.PlaySound("effect2");

                //if (_soundManager.IsSoundPlaying(soundOne))
                //{
                //    _soundManager.StopSound(soundOne);
                //}
            }
        }

        public void Render()
        {
            // The sound test doesn't need to render anything.
        }
    }
}